package main
import "fmt"

type Books struct {
	title string
	author string
	subject string
	book_id int
	price float64
}

// go语言不支持,结构体中变量设置默认值
// 可以通过函数实现
func new_books(title string, author string) Books{
	return Books{
		title,
		author,
		"unknown",
		0,
		10.0,
	}
}

func main(){
	book_economy := new_books("经济学-国富论","亚当·斯密")
	fmt.Println(book_economy)
}
/* Run:
{经济学-国富论 亚当·斯密 unknown 0 10}

*/